//
//  HomeRootHeaderView.m
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2022/9/3.
//

#import "HomeRootHeaderView.h"

@interface HomeRootHeaderView ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *subTitleLabel;

@end

@implementation HomeRootHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.clipsToBounds = YES;
        
//        UIView *topView = [[UIView alloc] init];
//        topView.backgroundColor = [UIColor redColor];
//        [self addSubview:topView];
//        [topView mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.left.right.top.equalTo(self);
//            make.height.mas_equalTo(80);
//        }];
        self.contentView.backgroundColor = [UIColor whiteColor];
        UILabel *titleLabel = [[UILabel alloc] init];
        titleLabel.font = [UIFont boldSystemFontOfSize:18];
        titleLabel.textColor = [UIColor blackColor];
        [self.contentView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(14);
            make.top.equalTo(self).offset(15);
        }];
        
        UILabel *subTitleLabel = [[UILabel alloc] init];
        subTitleLabel.font = [UIFont boldSystemFontOfSize:14];
        subTitleLabel.textColor = kColor888888;
        [self.contentView addSubview:subTitleLabel];
        [subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(titleLabel);
            make.top.equalTo(titleLabel.mas_bottom).offset(10);
        }];
        
        self.titleLabel = titleLabel;
        self.subTitleLabel = subTitleLabel;
        
        [self initData];
    }
    return self;
}

- (void)setTitle:(NSString *)title
{
    self.titleLabel.text = title;
}
- (void)setSubtitle:(NSString *)subtitle
{
    self.subTitleLabel.text = subtitle;
}

- (void)initData{};

+(CGFloat)height
{
    return 80;
}


@end
